package com.songtech.server.Jedis;

import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.RedisSerializer;

import javax.annotation.Resource;
import java.io.Serializable;

/**
 * Create By YINN on 2018/4/9 18:23
 * Description :
 */

public abstract class AbstractJedisDaoImpl<K extends Serializable, V extends Serializable> {

    @Resource
    protected RedisTemplate<K, V> redisTemplate;

    /**
     * 设置redisTemplate
     *
     * @param redisTemplate the redisTemplate to set
     */
    public void setRedisTemplate(RedisTemplate<K, V> redisTemplate) {
        this.redisTemplate = redisTemplate;
    }

    /**
     * 获取 RedisSerializer
     * <br>------------------------------<br>
     */
    protected RedisSerializer<?> getRedisSerializer() {
        return  redisTemplate.getDefaultSerializer();
    }

}